<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const year=parseInt(prompt("输入年份:"));
        const mounth=parseInt(prompt("输入月份:"));
        const day=parseInt(prompt("输入日:"));
        const hour=parseInt(prompt("输入时:"));
        const minutes=parseInt(prompt("输入分:"));
        const seconds=parseInt(prompt("输入秒:"));
Time_sql(year,mounth,day,hour,minutes,seconds);
        function Time_sql(year,mounth,day,hour,minutes,seconds){
            const date=new Date(year,mounth,day,hour,minutes,seconds);
            
           years= date.getFullYear();
            mouths=date.getMonth();
            days=date.getDay();
            hours=date.getHours();
            mis=date.getMinutes();
            sed=date.getSeconds();
            //组装起来
            dates=`时间为:${years}年-${mouths}月-${days}日 ${hours}:${mis}:${sed}`
          console.log(dates);
        }
// console.log(typeof (parseInt(year)));
    </script>
</body>
</html>